import { IFeidaoAiBrowserComponent, IFeidaoAiNodejsComponent } from '@feidao/web/interfaces';
import get_lang from './get-lang';

export default function i18n(fd: IFeidaoAiBrowserComponent | IFeidaoAiNodejsComponent, obj: { [key: string]: string; }) {
	const lang = get_lang(fd);
	if (lang in obj) {
		return obj[lang];
	} else {
		throw new Error('Cound not find language');
	}
}
